#ifndef DATABASE_COMMAND_H
#define DATABASE_COMMAND_H
namespace utility
{
namespace database
{
    enum DATABASE_TYPE
    {
        MYSQL_DB        = 0,
        POSTGRESQL_DB   = 1
    };

    const int MAX_SQL_LENGTH = 1024;

    class error_code
    {
    public:
        error_code():_value(0){}
        // explicit constructor
        error_code(int value, const char * msg)
        {
            set_error(value, msg);
        }

        void set_error(int value, const char * msg)
        {
            _value = value;
            _message = msg;
        }

        // get the error code
        int value() const { return _value; }

        std::string message() const {return _message;}

        bool operator !() const
        {
            return _value == 0;
        }

    private:
        int _value;
        std::string _message;

    };
}
}

#endif // endif
